'''
Created on 06/08/2012

@author: Romina
'''
from domain.entity import Entity


class Sector(Entity):
 
    @staticmethod
    def deserialize(fields):
        sector = Sector()
        sector.ID = fields.id
        sector.descripcion = fields.descripcion
        sector.admite_derivacion = fields.admite_derivacion
        return sector
    
    @property
    def descripcion(self):
        return self.__descripcion
    @descripcion.setter
    def descripcion(self, value):
        if isinstance(value, str):
            self.__descripcion = value
            
    @property
    def admite_derivacion(self):
        return self.__admite_derivacion
    @admite_derivacion.setter
    def admite_derivacion(self, value):
        self.__admite_derivacion = value
            
    def __init__(self):
        Entity.__init__(self)
        self.__descripcion = ""
        self.__admite_derivacion = False


class Usuario(Entity):
    
    @property
    def nombre(self):
        return self.__nombre
    @nombre.setter
    def nombre(self, value):
        if isinstance(value, str):
            self.__nombre = value
            
    @property
    def apellido(self):
        return self.__apellido
    @apellido.setter
    def apellido(self, value):
        if isinstance(value, str):
            self.__apellido = value
            
    @property
    def username(self):
        return self.__username
    @username.setter
    def username(self, value):
        if isinstance(value, str):
            self.__username = value
            
    @property
    def password(self):
        return self.__password
    @password.setter
    def password(self, value):
        if isinstance(value, str):
            self.__password = value
            
    @property
    def mail(self):
        return self.__mail
    @mail.setter
    def mail(self, value):
        if isinstance(value, str):
            self.__mail = value
            
    @property
    def sector(self):
        return self.__sector
    @sector.setter
    def sector(self, value):
        if isinstance(value, Sector()):
            self.__sector = value
            
    def __init__(self):
        Entity.__init__(self)
        self.__nombre = ""
        self.__apellido = ""
        self.__password = ""
        self.__sector = Sector()
        self.__username = ""
        self.__mail = ""
        